package com.czk.model.buildermodel;

/**
 * 指挥者，怎么建造，顺序等
 */
public class HouseDirector {
    private HouseBuilder houseBuilder=null;
    //传入不同的实现建造者
    public HouseDirector(HouseBuilder houseBuilder){
        this.houseBuilder=houseBuilder;
    }
    public void setHouseBuilder(HouseBuilder houseBuilder){
        this.houseBuilder=houseBuilder;
    }
    // 如何建造房子，交由指挥者完成
    public House constructHouse(){
        houseBuilder.basic();;
        houseBuilder.wall();
        houseBuilder.roof();
        return houseBuilder.build();
    }
}
